package ooday04;

public class AnimalTest {
    public static void main(String[] args) {
        Animal[] ani = new Animal[5];
        ani[0] = new Dog("大白",9,"白白");
        ani[1] = new Dog("小白",8,"白");
        ani[2] = new Fish("大黑",7,"黑");
        ani[3] = new Fish("小黑",6,"黑黑");
        ani[4] = new Chicken("老白",7,"黑黑黑");

//        for(int i=0;i<ani.length;i++) {
//            System.out.println(ani[i].name);
//            ani[i].eat();
//            ani[i].drink();
//
//            if (ani[i] instanceof Dog) {
//                Dog dog = (Dog)ani[i];
//                dog.swim();
//            }
//            if (ani[i] instanceof Fish) {
//                Fish fish = (Fish)ani[i];
//                fish.swim();
//            }
//            if (ani[i] instanceof Chicken) {
//                Chicken chick = (Chicken)ani[i];
//                chick.layEggs();
//            }
//
//        }
        System.out.println(ani[0] instanceof Animal);

//
//        Fish fish = (Fish)ani[2];
//        System.out.println(fish.name);
//        System.out.println();
//
//        Master master = new Master();
//        master.feed(ani[0]);
//        master.feed(ani[2]);
//        master.feed(ani[4]);




    }
}
